<?php
$html->addCrumb('Manager','/manager/');
$html->addCrumb('Meldung verwalten','/manager/notices/');

echo  $this->element('tasks',array('target'=>'/manager/notices'));
?>
<div class="title">
	Meldungen verwalten
	<?php
	if(isset($this->params['url']['print'])){
		echo $companyName;
	}
	?>
</div>

	<?php echo $this->element('flashMessage') ?>


	<?php
	echo $this->Form->create('Company',array('type'=>'GET','url'=>array('controller' => 'notices', 'action' => 'index'),'class'=>'form noprint'));

	echo $this->Form->input('company_id',array('label'=>'Unternehmen auswählen','selected'=>$companyId,'style'=>'float:left;'));

	echo '<div class="form_div_buttons noprint">';
	echo '<input type="submit" name="Auswählen" value="Auswählen">';
	echo '</div><br><br>';

	echo $this->Form->end();

	if(!empty($this->data)){
		$out = '
			<table>
				<tr>
					<th>Datum</th>
					<th>Studienrichtung</th>
					<th>Anzahl Stud.</th>
				</tr>
		';
		foreach($this->data as $key => $value){
			$out .= '<tr>';
			$out .= '	<td>'.$value['Notice']['record_date'].'</td>';
			$out .= '	<td>'.$value['StudyBranch']['branch_name'].'</td>';
			$out .= '	<td>'.$value['Notice']['students_quantity'].'</td>';
			$out .= '</tr>';
		}
		$out .= '<table>';
		echo $out;
	}else{
		if(!isset($companyId)){
			echo '<br><div class="message">Es sind keine Meldungen vorhanden.<div>';
		}
	}

	//debug($this->data);
?>